package com.yan_jiu_sheng.JavaAdvance.thread;

/**
 * @author yulongTian
 * @create 2024-05-25 22:02
 */
public class Test01 {
    public static void main(String[] args) {
        //创建线程对象
        MyThread t1 = new MyThread();
        t1.setName("哈哈");
        MyThread t2 = new MyThread();
        t2.setName("hello");
        t1.setPriority(1);
        t2.setPriority(10);
        System.out.println(t1.getPriority());
        System.out.println(t2.getPriority());
        //调用start方法，开启线程，jvm自动调用run方法
        t1.start();
        t2.start();
//        for (int i = 0; i < 10; i++) {
//            System.out.println(Thread.currentThread().getName() + "...................执行了" + i);
//        }
    }
}
